package com.klw.business.service.impl;

import java.util.List;

import com.klw.business.domain.KlmBatchModel;
import com.klw.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.klw.business.mapper.KlwStudentBehaviorMapper;
import com.klw.business.domain.KlwStudentBehavior;
import com.klw.business.service.IKlwStudentBehaviorService;

/**
 * 学生行为记录Service业务层处理
 * 
 * @author klw
 * @date 2025-09-13
 */
@Service
public class KlwStudentBehaviorServiceImpl implements IKlwStudentBehaviorService 
{
    @Autowired
    private KlwStudentBehaviorMapper klwStudentBehaviorMapper;

    /**
     * 查询学生行为记录
     * 
     * @param behaviorId 学生行为记录主键
     * @return 学生行为记录
     */
    @Override
    public KlwStudentBehavior selectKlwStudentBehaviorByBehaviorId(Long behaviorId)
    {
        return klwStudentBehaviorMapper.selectKlwStudentBehaviorByBehaviorId(behaviorId);
    }

    /**
     * 查询学生行为记录列表
     * 
     * @param klwStudentBehavior 学生行为记录
     * @return 学生行为记录
     */
    @Override
    public List<KlwStudentBehavior> selectKlwStudentBehaviorList(KlwStudentBehavior klwStudentBehavior)
    {
        return klwStudentBehaviorMapper.selectKlwStudentBehaviorList(klwStudentBehavior);
    }

    /**
     * 新增学生行为记录
     * 
     * @param klwStudentBehavior 学生行为记录
     * @return 结果
     */
    @Override
    public int insertKlwStudentBehavior(KlwStudentBehavior klwStudentBehavior)
    {
        klwStudentBehavior.setCreateTime(DateUtils.getNowDate());
        return klwStudentBehaviorMapper.insertKlwStudentBehavior(klwStudentBehavior);
    }

    /**
     * 修改学生行为记录
     * 
     * @param klwStudentBehavior 学生行为记录
     * @return 结果
     */
    @Override
    public int updateKlwStudentBehavior(KlwStudentBehavior klwStudentBehavior)
    {
        klwStudentBehavior.setUpdateTime(DateUtils.getNowDate());
        return klwStudentBehaviorMapper.updateKlwStudentBehavior(klwStudentBehavior);
    }

    /**
     * 批量删除学生行为记录
     * 
     * @param behaviorIds 需要删除的学生行为记录主键
     * @return 结果
     */
    @Override
    public int deleteKlwStudentBehaviorByBehaviorIds(Long[] behaviorIds)
    {
        return klwStudentBehaviorMapper.deleteKlwStudentBehaviorByBehaviorIds(behaviorIds);
    }

    /**
     * 删除学生行为记录信息
     * 
     * @param behaviorId 学生行为记录主键
     * @return 结果
     */
    @Override
    public int deleteKlwStudentBehaviorByBehaviorId(Long behaviorId)
    {
        return klwStudentBehaviorMapper.deleteKlwStudentBehaviorByBehaviorId(behaviorId);
    }

    /**
     * 获取学生指定学期行为总分
     * @param klmBatchModel
     * @return
     */
    @Override
    public Long selectBehaviorScoreByParam(KlmBatchModel klmBatchModel) {
        return klwStudentBehaviorMapper.selectBehaviorScoreByParam(klmBatchModel);
    }
}
